import request from '@/utils/request'

export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  //api
 // return request({
   // url: '/api/v1/login',
   // method: 'post',
  //  data: {"apiVersion":"v1","kind":"adinfosys","data":{"username":username,"password":password}}

//})
//}
  //mock
return request({
  url: '/api/v1/login',
  method: 'post',
  data
})
}
export function logout() {
  return request({
    url: '/api/v1/logout',
    method: 'get'
  })
}

export function getUserInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}

